Skip to main content

androidHasPermission

Type​

function

Summary​

Returns if permission permissionName has been granted by the user.

Syntax​

androidHasPermission(<permissionName>)

Description​

Use the androidRequestPermission function to find out if permission permissionName has been granted by the user.

note

Permission names are case sensitive.

Parameters​

NameTypeDescription

permissionName

enum

The name of the permission to request.

Examples​

local tLocationPermissionGranted
put androidHasPermission("android.permission.ACCESS_FINE_LOCATION") into tLocationPermissionGranted
if not tLocationPermissionGranted then
androidRequestPermission "android.permission.ACCESS_FINE_LOCATION"
end if
if not tLocationPermissionGranted then
answer "This app is not permitted to access the device location. You can change this" && \
"in the Settings app."
end if

Value​

NameTypeDescription

return

boolean

True if permission has been granted, false otherwise.

Compatibility and Support​

Introduced

LiveCode 9.0.1

OS

android

Platforms

mobile

Thank you for your feedback!

Was this page helpful?